package simplifiedPastry.simulation;

import java.net.InetAddress;
import java.net.SocketException;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
import simplifiedPastry.Message;
import simplifiedPastry.Node;
import simplifiedPastry.NodeId;
import simplifiedPastry.Pair;
import simplifiedPastry.exceptions.NodeConnectionException;
import simplifiedPastry.exceptions.NodeStateException;
import simplifiedPastry.exceptions.ServerRemoveCountException;

public interface Server extends Remote {
	public void addNodes(ArrayList<Pair<NodeId, Integer>> nodes) throws RemoteException;
	public void createNewNet() throws RemoteException, SocketException, NodeStateException;
	public void joinAll(InetAddress address, int port) throws RemoteException, NodeStateException, SocketException, NodeConnectionException;
	public void disconnectAll() throws RemoteException;
	public void removeNodes(Integer number) throws RemoteException, ServerRemoveCountException;
	public void addGlobalNodes(ArrayList<NodeTest> nodes) throws RemoteException;
	public void sendMessage(Message message) throws RemoteException;
	public void sendRandom(Integer messageNum) throws RemoteException;
	public RegistratorData getRegistredData() throws RemoteException;
}
